Repository navigation
fix(fluentbit): render structuredMetadataKeys of the Loki output as structured_metadata_map_keys - #2150
Open
lbarrosby wants to merge 1 commit into
Open
fix(fluentbit): render structuredMetadataKeys of the Loki output as structured_metadata_map_keys#2150lbarrosby wants to merge 1 commit into
lbarrosby wants to merge 1 commit into
Conversation
…tructured_metadata_map_keys Fluent Bit has no structured_metadata_keys property; its Loki output rejects it as an unknown configuration property and the instance fails to start. The option for record keys whose maps become structured metadata is structured_metadata_map_keys (Fluent Bit 4.0+). Signed-off-by: Lucas Barros <lucasbarros.kam@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
The Fluent Bit Loki output (
Loki.Params) rendersstructuredMetadataKeysasstructured_metadata_keys:Fluent Bit has never had that property.
out_lokionly knowsstructured_metadataand, since 4.0,structured_metadata_map_keys(plugins/out_loki/loki.cconfig map, checked up to v5.2.0). Output properties are validated against the config map at init (flb_config_map_properties_checkinsrc/flb_output.c), so aClusterOutputwithstructuredMetadataKeysmakes Fluent Bit fail withunknown configuration property 'structured_metadata_keys'and the Loki output never starts.This renders the field as
structured_metadata_map_keys, the Fluent Bit option for "record keys whose values become structured metadata": each listed key (a record accessor such as$kubernetes['labels']) must point to a map, and its key/value pairs are added as structured metadata. The field description, the CRDs,manifests/setup/setup.yamlanddocs/plugins/fluentbit/output/loki.mdare updated to say so; single values keep going throughstructuredMetadata(key=${record[...]}).Tests:
TestLokiOutputWithStructuredMetadata_Loadand_LoadAsYamlexpectedstructured_metadata_keys level,caller; they now use map keys and expectstructured_metadata_map_keys. With the old key name inloki_types.goboth fail.go test ./apis/...passes,golangci-lint runon the output package reports no issues.Which issue(s) this PR fixes:
None, found while comparing the keys the operator renders with the Fluent Bit config maps.
Does this PR introduced a user-facing change?
Additional documentation, usage docs, etc.: